package com.hzit.sb2.util.weixin;

import org.dom4j.Document;
import org.dom4j.Element;
import org.springframework.stereotype.Component;


@Component
public class Dom4jUtil {
    /**
     * 根据节点获取值
     * @param document
     * @param name
     * @return
     */
    public String getValue(Document document, String name){
        Element rootElement = document.getRootElement();
        Element element = rootElement.element(name);
        String value = element.getTextTrim();
        return value;
    }
}
